public class Student {
    private String className;
    private String studentId;
    private String name;
    private String gender;
    private double javaScore;
    private double webDesignScore;
    private double englishScore;

    /**
     * 构造函数，用于初始化学生对象
     */
    public Student(String className, String studentId, String name, String gender, double javaScore, double webDesignScore, double englishScore) {
        this.className = className;
        this.studentId = studentId;
        this.name = name;
        this.gender = gender;
        this.javaScore = javaScore;
        this.webDesignScore = webDesignScore;
        this.englishScore = englishScore;
    }

    // 以下是各个属性的 getter 方法

    public String getClassName() {
        return className;
    }

    public String getStudentId() {
        return studentId;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public double getJavaScore() {
        return javaScore;
    }

    public double getWebDesignScore() {
        return webDesignScore;
    }

    public double getEnglishScore() {
        return englishScore;
    }

    /**
     * 计算学生的总成绩

     */
    public double getTotalScore() {
        return javaScore + webDesignScore + englishScore;
    }

    /**
     * 计算学生的平均成绩

     */
    public double getAverageScore() {
        return getTotalScore() / 3;
    }

    /**
     * 设置 Java 成绩

     */
    public void setJavaScore(double javaScore) {
        this.javaScore = javaScore;
    }

    /**
     * 设置网页设计成绩

     */
    public void setWebDesignScore(double webDesignScore) {
        this.webDesignScore = webDesignScore;
    }

    /**
     * 设置英语成绩

     */
    public void setEnglishScore(double englishScore) {
        this.englishScore = englishScore;
    }

    /**
     * 重写 toString 方法，方便打印学生信息

     */
    @Override
    public String toString() {
        return "班级：" + className + ", 学号：" + studentId + ", 姓名：" + name + ", 性别：" + gender + ", Java 成绩：" + javaScore + ", 网页设计成绩：" + webDesignScore + ", 英语成绩：" + englishScore;
    }
}


